package org.infodavid.common.notifier;

import java.io.Serializable;
import java.util.List;

import org.joda.time.DateTime;

import org.infodavid.common.notifier.exceptions.NotifierException;

/**
 * The Interface INotifier.
 */
public interface INotifier extends Serializable {

	/**
	 * Send the notification.
	 * @param commands the commands
	 * @return the acknowledgment
	 * @throws NotifierException the notifier exception
	 */
	IAcknowledgment[] send(INotifierCommand... commands) throws NotifierException;

	/**
	 * Send the notification.
	 * @param date the date
	 * @param commands the commands
	 * @return the acknowledgment
	 * @throws NotifierException the notifier exception
	 */
	IAcknowledgment[] send(DateTime date, INotifierCommand... commands) throws NotifierException;

	/**
	 * List currently executing commands.
	 * @param start the start record
	 * @param size the number of records to return
	 * @return the list of records
	 * @throws NotifierException the notifier exception
	 */
	List<INotifierCommand> listRunning(final int start, final int size) throws NotifierException;

	/**
	 * List scheduled commands.
	 * @param start the start record
	 * @param size the number of records to return
	 * @return the list of records
	 * @throws NotifierException the notifier exception
	 */
	List<INotifierCommand> listScheduled(final int start, final int size) throws NotifierException;

	/**
	 * Cancel.
	 * @param keys the keys
	 * @throws NotifierException the notifier exception
	 */
	void cancel(final String... keys) throws NotifierException;
}
